package sorting;

import java.util.Arrays;

import util.ArrayUtil;


public class InsertionSort {
	public static void sort(float[] numbers)
	{
		for(int i = 1; i < numbers.length; i ++)
		{
			for(int j = i; j > 0 && numbers[j] < numbers[j - 1]; j --)
			{
				ArrayUtil.each(numbers, j, j - 1);
			}
		}
	}
	
	public static void main(String[] args) {
		float[] numbers = {5,6,8,9,7,1,2,6,8,7,6,4};
		sort(numbers);
		System.out.println(Arrays.toString(numbers));
	}
}
